#include "Operation_Rf1.h"


Operation_Rf1::Operation_Rf1(char ch, int nNum1, int nNum2) :
m_ch(ch), m_nNum1(nNum1), m_nNum2(nNum2)
{
}


Operation_Rf1::~Operation_Rf1(void)
{
}

int Operation_Rf1::Caculation()
{
	int retValue = 0;
	switch (m_ch)
	{
	case '+':
		retValue = Add();
		break;
	case '-':
		retValue = Sub();
		break;
	default:
		retValue = Add();
	}

	return retValue;
}

int Operation_Rf1::Add()
{
	return m_nNum1 + m_nNum2;
}

int Operation_Rf1::Sub()
{
	return m_nNum1 - m_nNum2;
}